/* eslint-disable */
/**
 * Created by GYL on 2018/8/24
 */
//查看主体
import React, { Component } from 'react';
import styles from '../index.less';
import { Divider, Collapse, Icon, Select, Input, Tooltip, Form, Row, Col, TreeSelect, Tag, message, Tabs } from 'antd';
import PublicService from "../../../services/PublicService";
import config from '../../../config';
import Util from '../../../utils/Util';
import request from '../../../utils/request';
import MyTable from "../../../components/common/MyTable";
import CheckSubEvent from './CheckSubEvent';
import MyModal from '../../../components/common/MyModal';
const { Panel } = Collapse;
const { Option } = Select;
const { TextArea } = Input;
const FormItem = Form.Item;
const { SHOW_CHILD } = TreeSelect;
const TabPane = Tabs.TabPane;
const text = `
  A dog is a type of domesticated animal.
  Known for its loyalty and faithfulness,
  it can be found as a welcome guest in many households across the world.
`;
const IconFont = Icon.createFromIconfontCN({
    scriptUrl: '//at.alicdn.com/t/font_1315525_8ark569k0xh.js',
});
var indexNum = 0
var fengxianArr = []
class Check_Wrap extends Component {

    constructor(props) {
        super(props)

    }

    componentDidMount() {
        indexNum = 0
        // console.log(this.props)
        let params = {}
        request({
            url: '/pm-web/projectmanage/role/getTreeData',
            method: 'POST',
            data: {notManagementLayer:true}
        }).then(data => {
            this.setState({
                arr: this.state.arr,
                treeArr: data.ret
            })
        })

        //查询子责任部门

        request({
            url: '/pm-web/projectmanage/role/getTreeData',
            method: 'POST',
            data: { parentId: "", roleLevel: 1,notManagementLayer:true }
        }).then(data => {
            // console.log(data)

            this.setState({

                treeArr1: data.ret
            })

        })

        this.props.EditArr.riskProtectionList.forEach((item, index) => {
            indexNum++
            this.state.arr[7].list.push(
                {
                    type: 'TextArea',
                    paramName: (new Date()).valueOf() + index + 'fengxian',
                    id: (new Date()).valueOf() + 'fengxian',
                    title: '0/100',
                    num: 100,
                    key: (new Date()).valueOf() + 'fengxian',
                    label: `#${index + 1}风险信息`,
                    rules: [{ ...config.reg.required }],
                    span: 12,
                    rows: 2,
                    className: styles.fengxian,
                    style: { width: 500 },
                    initialValue: item.measures,
                    shuoming: styles.anquanxinxi,
                    index: indexNum,
                    disabled: false
                },
                {
                    type: 'TextArea',
                    paramName: (new Date()).valueOf() + index + 'cuoshi',
                    id: (new Date()).valueOf() + 'cuoshi',
                    title: '0/100',
                    num: 100,
                    key: (new Date()).valueOf() + 'cuoshi',
                    label: `#${index + 1}对应措施`,
                    rules: [{ ...config.reg.required }],
                    span: 12,
                    rows: 2,
                    className: styles.cuoshi,
                    style: { width: 500 },
                    initialValue: item.riskName,
                    shuoming: styles.duiyingcuoshi,
                    index: indexNum,
                    disabled: false
                },
                {
                    type: 'delete',
                    span: 1,
                    index: indexNum,
                }
            )

        })

        //实时库
        // this.props.EditArr.knowledgeBaseList.forEach((item, index) => {
        //     this.state.arr[13].list.push(
        //         {
        //             type: 'TextArea',
        //             paramName: (new Date()).valueOf() + index + 'zhishiku',
        //             id: (new Date()).valueOf() + 'zhishiku',
        //             title: '0/500',
        //             num: 100,
        //             key: (new Date()).valueOf() + "zhishiku",
        //             label: '知识库信息',
        //             rules: [{ ...config.reg.required }],
        //             span: 24,
        //             rows: 3,
        //             colSpan: 24,
        //             style: { width: 550 },
        //             // disabled: true,
        //             initialValue: item.content,
        //         },

        //     )
        // })

        this.props.EditArr.subeventsBasicInfoList.forEach((item, index) => {
            this.state.subEventArr.push(item)
        })
        this.state.subEventArr.forEach((item, index) => {
            item.num = index + 1
        })

        setTimeout(() => {
            // console.log(this.state.subEventArr)
            this.setState({
                arr: this.state.arr,
                subEventArr: this.state.subEventArr
            })
        })

    }

    state = {
        Task: [],
        treeArr: [],//一般下拉
        selectedRowKeys: [],
        subeventsBasicId: '',//子事件id
        arr: [
            {
                type: 'title',
                name: "基本信息",
                span: 24,
                backgroundColor: '#206bdc',
                color: '#206bdc',
                marginTop: 10,
                height: 30
            },
            {
                type: 'TextArea',
                paramName: 'eventBasicName',
                id: 'eventBasicName',
                title: '0/30',
                num: 30,
                key: "eventBasicName",
                label: '事件名称',
                style: { width: 228 },
                rules: [{ ...config.reg.required }],
                span: 8,
                rows: 2,
                initialValue: this.props.EditArr.eventBasicName
            },
            {
                type: 'TextArea',
                paramName: 'eventBasicDescribe',
                id: 'eventBasicDescribe',
                title: '0/200',
                num: 200,
                key: "eventBasicDescribe",
                label: '事件说明',
                style: { width: 602 },
                rules: [{ ...config.reg.required }],
                span: 16,
                rows: 2,
                shuoming: styles.shuoming,
                initialValue: this.props.EditArr.eventBasicDescribe
            },
            {
                type: 'select',
                paramName: 'superior',
                id: 'superior',
                key: "superior",
                label: '事件顺序',
                rules: [{ ...config.reg.required }],
                span: 8,
                style: { width: 228 },
                shuoming: styles.shijianshangji,
                placeholder: '请选择',
                options: [
                    { text: '无', value: '0' },
                    ...this.props.AddArr
                ],
                initialValue: this.props.EditArr.superior
            },
            {
                type: 'select',
                paramName: 'eventBasicAttribute',
                id: 'eventBasicAttribute',
                key: "eventBasicAttribute",
                label: '事件属性',
                rules: [{ ...config.reg.required }],
                span: 8,
                style: { width: 228 },
                shuoming: styles.shijianshuxing,
                placeholder: '请选择',
                options: [
                    { text: '必选项', value: '1' },
                    { text: '非必选项', value: '2' },
                ],
                initialValue: this.props.EditArr.eventBasicAttribute
            },
            {
                type: 'select',
                paramName: 'eventBasicStage',
                id: 'eventBasicStage',
                key: "eventBasicStage",
                label: '事件阶段',
                rules: [{ ...config.reg.required }],
                span: 8,
                style: { width: 228 },
                shuoming: styles.shijianjieduan,
                placeholder: '请选择',
                options: [
                    { text: '项目前期', value: '1' },
                    { text: '项目实施', value: '2' },
                    { text: '项目验收', value: '3' },
                    { text: '项目结算', value: '4' },
                ],
                initialValue: this.props.EditArr.eventBasicStage
            },

            // {
            //     type: 'title',
            //     name: "安全信息",
            //     span: 24,
            //     backgroundColor: '#1fd02e',
            //     color: '#1fd02e',
            //     marginTop: 10,
            //     height: 30
            // },
            // {
            //     type: 'TextArea',
            //     paramName: 'safetyInformation',
            //     id: 'safetyInformation',
            //     title: '0/200',
            //     num: 200,
            //     key: "safetyInformation",
            //     label: '安全信息/防护措施',
            //     rules: [{ ...config.reg.required }],
            //     span: 12,
            //     rows: 2,
            //     style: { width: 500 },
            //     className: styles.anquan,
            //     shuoming: styles.anquanxinxi,
            //     initialValue: this.props.EditArr.safetyInformation
            // },
            // {
            //     type: 'treeSelect',
            //     paramName: 'safetyInformationList',
            //     id: 'safetyInformationList',
            //     title: '0/200',
            //     num: 200,
            //     key: "safetyInformationList",
            //     label: '安全提示部门',
            //     rules: [{ ...config.reg.required }],
            //     treeCheckable: true,
            //     span: 12,
            //     rows: 2,
            //     maxTagCount: 5,
            //     style: { width: 500 },
            //     shuoming: styles.anquanxinxi,
            //     treeData: this.props.EditArr.treeArr,
            //     initialValue: this.props.EditArr.safetyInformationIdList

            // },
            {
                type: 'title',
                name: "风险信息",
                span: 24,
                backgroundColor: '#dc8a20',
                color: '#dc8a20',
                marginTop: 10,
                height: 30
            },
            {
                type: 'arr',
                list: [


                ]
            },
            {
                type: 'button',
                span: 1,
                pull: 2
            },
            {
                type: 'title',
                name: "子事件信息",
                span: 24,
                backgroundColor: '#5f5b5b',
                color: '#5f5b5b',
                marginTop: 0,
                height: 30
            },
            // {
            //     type: 'arr',
            //     list: [


            //     ]

            // },

        ],
        roleIdArr: [],
        expandIconPosition: 'left',
        title: '添加子事件',
        subEvent: false,
        subEventArr: [],
        sonArrList: []

    };


    //计算文本域内数字个数
    onChangeNum = (v) => {
        var strs = getByteLen(v);
        function getByteLen(val) {
            strs = val.replace(/[\ |\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?|\，|\。|\？|\：|\；|\‘|\’|\”|\“|\、|\·|\！|\（|\）|\》|\《|\『|\』]/g, "");
            return strs;
        }
        return strs.length

    }
    // 取消保存
    ModalCancel = (type) => {
        let t = this;
        t.setState({
            [type]: false,
            modalBtnLoading: false
        })
    };



    // 筛选条件组件change事件
    getChangeValue = (value, e) => {
        let t = this;
        let params = {};
        params[value] = e.target.value;
        t.setState({ params });
        //form表单赋值-----改变文本域数字个数
        this.props.form.setFieldsValue({ [value]: e.target.value })
        this.addChange(value, this.onChangeNum(e.target.value))


    }



    getChangeValueList = (value, e) => {
        let t = this;
        let params = {};
        params[value] = e.target.value;
        t.setState({ params });
        //form表单赋值-----改变文本域数字个数
        this.props.form.setFieldsValue({ [value]: e.target.value })
        this.addChangeList(value, this.onChangeNum(e.target.value))


    }

    addChangeList = (v, num) => {
        this.state.arr[7].list.forEach(item => {
            if (item.paramName === v) {
                item.title = `${num}/${item.num}`
            }
        });
    }

    addChangeSon = (v, num, index) => {
        this.state.sonArr[index].sonArrList.forEach(item => {
            if (item.paramName === v) {
                item.title = `${num}/${item.num}`
            }
        });
    }
    //新增改变tooplie的显示文字
    addChange = (v, num) => {
        this.state.arr.forEach(item => {
            if (item.paramName === v) {
                item.title = `${num}/${item.num}`
            }
        });
    }

    //保存按钮事件
    onModalSave = () => {
        let num = 0
        // console.log(this.state.subEventArr,)
        // if (this.state.subEventArr.length > 0) {
        //     this.state.subEventArr.forEach((item) => {
        //         num += Number(item.subeventsBasicWeight)
        //         console.log(item.subeventsBasicWeight)

        //     })
        //     console.log(num)
        //     if (num != 1) {
        //         message.warning('子事件权重之和必须等于1,请重新输入!')
        //         return
        //     }
        // } else {
        //     message.warning('请录入子事件')
        //     return
        // }

        let riskProtectionList = []
        let riskProtectionList1 = []
        let knowledgeBaseList = []
        this.props.form.validateFields((errors, values) => {
            if (!errors) {
                request({
                    url: '/pm-web/projectmanage/eventbasicinfo/getWeight',
                    method: 'POST',
                    data: { eventBasicId: this.state.eventBasicId }
                }).then(data => {
                    if (data.rc === 0) {
                        for (var i in values) {
                            // console.log()
                            if (i.indexOf('cuo') > 0) {
                                riskProtectionList.push({
                                    riskName: values[i],
                                })
                            }
                            if (i.indexOf('fengxian') > 0) {
                                riskProtectionList1.push({
                                    measures: values[i],
                                })
                            }


                        }
                        setTimeout(() => {
                            let arr = []
                            // let safetyInformationList = []
                            riskProtectionList.forEach((item, index) => {
                                arr.push({
                                    riskName: riskProtectionList[index].riskName,
                                    measures: riskProtectionList1[index].measures
                                })
                            });
                            // console.log(fengxianArr, riskProtectionList)
                            //循环风险信息
                            fengxianArr.forEach((item, index) => {
                                arr.splice(item - 1, 1)
                            })

                            // console.log(fengxianArr, arr)


                            values.riskProtectionList = arr
                            values.subeventsBasicInfoList = this.state.subEventArr
                            values.creator = '测试'
                            values.lastChanger = '测试'
                            // values.safetyInformationList.forEach(item => {
                            //     safetyInformationList.push({
                            //         roleId: item
                            //     })
                            // });
                            // values.safetyInformationList = safetyInformationList
                            values.eventBasicId = this.props.eventBasicId

                            values.safetyInformationIdList = values.safetyInformationList
                            values.safetyInformationList = []
                            request({
                                url: '/pm-web/projectmanage/eventbasicinfo/updateEventBasicInfo',
                                method: 'POST',
                                data: values
                            }).then(data => {
                                // console.log(data)
                                if (data.rc === 0) {
                                    message.success('修改成功!')
                                    this.props.fanhui()
                                } else {
                                    message.warning('修改失败!')
                                }


                            })


                        }, 500)

                    } else {
                        message.warning(`当前子事件权重之和为${data.ret},请重新设置权重后保存`)
                    }
                })


            }




        });

    }
    //新增保存
    onModalSave1 = (v) => {
        // console.log(v)
        // console.log(v.subeventsBasicWeight)
        let num = 0
        if (this.state.subEventArr.length > 0) {
            this.state.subEventArr.forEach((item) => {
                num += Number(item.subeventsBasicWeight)

            })
            // console.log(num,Number(v.subeventsBasicWeight))
            if (num + Number(v.subeventsBasicWeight) > 1) {
                message.warning('子事件权重之和不能超出1,请重新输入!')
                return
            }
        }


        v.assistanceDepartmentRoleIdList = v.assistanceDepartmentRoles
        v.eventAuditRoleIdList = v.eventAuditRoleList
        v.eventAuditCCRoleIdList = v.eventAuditCCRoleList
        v.assistanceDepartmentRoles = []
        v.eventAuditCCRoleList = []
        v.eventAuditRoleList = []

        //协助部门角色列表
        // let assistanceDepartmentRoles = []
        // v.assistanceDepartmentRoles.forEach(item => {
        //     assistanceDepartmentRoles.push({
        //         roleId: item
        //     })
        // });

        // v.assistanceDepartmentRoles = assistanceDepartmentRoles

        //OA审核抄送角色列表	
        // if (v.eventAuditCCRoleList) {
        //     let eventAuditCCRoleList = []
        //     v.eventAuditCCRoleList.forEach(item => {
        //         eventAuditCCRoleList.push({
        //             roleId: item
        //         })
        //     });
        //     v.eventAuditCCRoleList = eventAuditCCRoleList
        // }

        v.preposeTaskBasicList = [{
            delayTime: '',
            num: '',
            type: ''
        }]
        v.list = [
            {
                value: "",
                name: '无'
            }, {
                value: "FS",
                name: '完成-开始'
            }, {
                value: "FF",
                name: '完成-完成'
            }, {
                value: "SF",
                name: '开始-完成'
            }, {
                value: "SS",
                name: '开始-开始'
            }
        ]


        //OA审核角色列表
        // if (v.eventAuditRoleList) {
        //     let eventAuditRoleList = []
        //     v.eventAuditRoleList.forEach((item, index) => {
        //         eventAuditRoleList.push({
        //             roleId: item,
        //             auditSn: index + 1
        //         })
        //     });

        //     v.eventAuditRoleList = eventAuditRoleList
        // }


        v.sureWay = v.sureWay === '用户勾选' ? 1 : 2
        v.auditWay = v.auditWay === '不需审核' ? 1 : v.auditWay === '系统内审核' ? 2 : v.auditWay === '系统内抄送' ? 3 : 4
        v.subeventsBasicWeight = Number(v.subeventsBasicWeight)
        this.state.subEventArr.push({ ...v })
        this.setState({
            MyModal1Visible: false,
            subEventArr: this.state.subEventArr
        })

    }


    selectedChange(fun, nextParams, paramName, index, value) {
        // console.log(fun, nextParams, paramName, index, value)


        let t = this;
        let params = {};
        params[paramName] = value;
        if (paramName) {
            t.setState({ params }, () => {
            });
        }
        if (typeof fun === "function") {
            fun(value);
            if (nextParams)
                t.props.form.setFieldsValue({
                    [nextParams]: ''
                })
        }
    }

    //新增风险信息
    addListfx = () => {

        indexNum++;
        this.state.arr[7].list.push(

            {
                type: 'TextArea',
                paramName: (new Date()).valueOf() + 'fengxian',
                id: (new Date()).valueOf() + 'fengxian',
                title: '0/100',
                num: 100,
                key: (new Date()).valueOf() + 'fengxian',
                label: `#${indexNum}风险信息`,
                rules: [{ ...config.reg.required }],
                span: 12,
                rows: 2,
                colSpan: 24,
                index: indexNum,
                style: { width: 500 },
                className: styles.fengxian,
                shuoming: styles.anquanxinxi,
                disabled: false
            },
            {
                type: 'TextArea',
                paramName: (new Date()).valueOf() + 'cuoshi',
                id: (new Date()).valueOf() + 'cuoshi',
                title: '0/100',
                num: 100,
                key: (new Date()).valueOf() + 'cuoshi',
                label: `#${indexNum}对应措施`,
                rules: [{ ...config.reg.required }],
                span: 12,
                rows: 2,
                colSpan: 24,
                index: indexNum,
                style: { width: 500 },
                className: styles.cuoshi,
                shuoming: styles.duiyingcuoshi,
                disabled: false
            },
            {
                type: 'delete',
                span: 2,
                index: indexNum,
            }

        )

        setTimeout(() => {
            this.setState({
                arr: this.state.arr
            })
        }, 200)
    }




    //多选
    onSelectChange = (selectedRowKeys, row) => {
        // console.log(selectedRowKeys, row)
        this.setState({ selectedRowKeys, row })
    };





    fanhui = () => {
        this.props.fanhui()
    }


    //删除风险信息
    onDelete = (inx) => {
        // console.log(inx)
        this.state.arr[7].list.forEach((item, index) => {
            if (item.index === inx) {
                // console.log(item)
                item.disabled = true
                // this.state.arr[10].list.splice(index, 3)
                //将删除的风险信息放入数组
                fengxianArr.push(inx)
            }
        })
        fengxianArr = Array.from(new Set(fengxianArr))
        //删除已经恢复的风险信息


        this.setState({
            arr: this.state.arr
        })
    }

    //删除子事件
    onEventDelete = (text, record, index) => {
        // console.log(text, record, index)
        this.state.subEventArr.splice(index, 1)
        this.setState({
            subEventArr: this.state.subEventArr
        })

    }
    //恢复风险信息
    onHuifu = (inx) => {
        //对风险信息对标进行去重
        fengxianArr = Array.from(new Set(fengxianArr))
        //删除已经恢复的风险信息
        Array.prototype.remove = function (val) {
            var index = this.indexOf(val);
            if (index > -1) {
                this.splice(index, 1);
            }
        };
        fengxianArr.remove(inx);
        // console.log(fengxianArr)
        this.state.arr[7].list.forEach((item, index) => {
            if (item.index === inx) {
                // console.log(item)
                item.disabled = false


            }
        })



        this.setState({
            arr: this.state.arr
        })
    }

    render() {
        let t = this
        let width = document.body.clientWidth;
        const height = document.body.clientHeight;
        let containerHeight = '76vh';
        let tableHeight = 310;
        if (width > 1367) {
            tableHeight = 380;
            containerHeight = '83vh';
        }
        const { expandIconPosition, selectedRowKeys } = this.state;
        let { getFieldDecorator } = this.props.form;
        const genExtra = () => (

            <span onClick={this.onDelete} style={{ color: 'red' }}>删除</span>
        );


        let rowSelection = {
            selectedRowKeys,
            onChange: this.onSelectChange.bind(this),
        };


        return (
            <div className={styles.addWrap}>
                <div className={styles.warpBox}>


                    {/* <div className={styles.Top_Box}>
                        <span style={{ fontWeight: 700, marginLeft: 10 }}>编辑事件</span>   <Icon type="close-circle" theme="twoTone" twoToneColor="red" onClick={this.fanhui} style={{ marginRight: 10, cursor: 'pointer' }} />

                    </div> */}

                    <div style={{ backgroundColor: '#fff', overflow: 'auto' ,height:'100%'}}>

                                <Form layout={'inline'} style={{ paddingLeft: 40, paddingRight: 40 }} >
                                    <Row gutter={48} key={55555}>
                                        {
                                            this.state.arr.map((item, index) => {
                                                if (item.type === 'TextArea') {
                                                    return (
                                                        <Col span={item.span || 8} key={index} className={item.className}>
                                                            <Form.Item label={item.label} key={item.paramName}>
                                                                <Tooltip
                                                                    trigger={['focus']}
                                                                    title={item.title}
                                                                    placement="topLeft"
                                                                    overlayClassName="numeric-input"
                                                                >
                                                                    {
                                                                        getFieldDecorator(item.paramName, {
                                                                            initialValue: item.initialValue ? item.initialValue : '',
                                                                            rules: item.rules || null
                                                                        })(

                                                                            <TextArea
                                                                                style={item.style}
                                                                                placeholder={item.placeholder}
                                                                                // onChange={this.onChange}
                                                                                className={item.shuoming}
                                                                                rows={item.rows}
                                                                                maxLength={item.num}
                                                                                disabled={true} id={[item.paramName]}
                                                                                onChange={this.getChangeValue.bind(this, item.paramName)} size={config.size}
                                                                            />

                                                                        )
                                                                    }
                                                                </Tooltip>
                                                            </Form.Item>
                                                        </Col>
                                                    )
                                                } else if (item.type === 'select') {
                                                    return (
                                                        <Col span={8} key={index}>
                                                            <Form.Item label={item.label} key={item.paramName} className={item.className} >
                                                                {
                                                                    getFieldDecorator(item.paramName, {
                                                                        initialValue: item.initialValue ? item.initialValue : (item.options[0] ? Util.numToString(item.options[0].value) : item.options[0]),
                                                                        rules: item.rules || null
                                                                    })(
                                                                        <Select
                                                                            size={config.size}
                                                                            showSearch
                                                                            style={item.style}
                                                                            mode={item.mode}
                                                                            placeholder="Select a person"
                                                                            className={item.shuoming}
                                                                            optionFilterProp="children"
                                                                            dropdownMatchSelectWidth={t.props.dropdownMatchSelectWidth}
                                                                            onChange={t.selectedChange.bind(t, item.selectChange, item.nextParamName || false, item.paramName)}
                                                                            onSelect={item.onSelect}
                                                                            disabled={true}
                                                                        >
                                                                            {
                                                                                item.options.map(option => {
                                                                                    return (
                                                                                        <Select.Option key={option.value}
                                                                                            value={Util.numToString(option.value)}
                                                                                        >
                                                                                            {option.text}
                                                                                        </Select.Option>

                                                                                    )
                                                                                })
                                                                            }
                                                                        </Select>
                                                                    )
                                                                }
                                                            </Form.Item>
                                                        </Col>
                                                    )
                                                } else if (item.type === 'treeSelect') {
                                                    return (
                                                        <Col span={item.span || 8} key={index}>
                                                            <Form.Item label={item.label} key={item.paramName} className={item.className} >
                                                                {
                                                                    getFieldDecorator(item.paramName, {
                                                                        initialValue: item.initialValue ? item.initialValue : null,
                                                                        rules: item.rules || null
                                                                    })(
                                                                        <TreeSelect
                                                                        disabled={true}
                                                                            treeData={item.treeData}
                                                                            onChange={t.selectedChange.bind(t, item.selectChange, item.nextParamName || false, item.paramName)}
                                                                            treeCheckable={item.treeCheckable}
                                                                            showCheckedStrategy={SHOW_CHILD}
                                                                            // searchPlaceholder={'请选部门'}
                                                                            style={item.style}
                                                                            maxTagCount={item.maxTagCount}
                                                                        />
                                                                    )
                                                                }
                                                            </Form.Item>
                                                        </Col>
                                                    )
                                                } else if (item.type === 'title') {
                                                    return (


                                                        <Col span={item.span || 8} key={index} style={{ paddingLeft: 0, paddingRight: 0, height: item.height ,marginBottom:15}}>
                                                            {/* <div style={{ width: "100%", borderBottom: "5px solid #423578",marginBottom:10 }}></div> */}
                                                            <h2 style={{ fontSize: 14, fontWeight: 700, position: 'relative', marginBottom: 0, marginTop: item.marginTop, marginBottom: 5,backgroundColor:'#F5F6F7' }}><span style={{ padding: 1, color: "#fff", backgroundColor: item.backgroundColor, position: 'absolute', left: '-15px', width: 5, height: 20 }}> </span><span style={{ color: item.color }}>{item.name}</span></h2>


                                                        </Col>


                                                    )
                                                } else if (item.type === 'arr') {
                                                    return (
                                                        item.list.map((item, index) => {
                                                            if (item.type === 'TextArea') {
                                                                return (
                                                                    <Col span={item.span || 8} key={index}>
                                                                        <Form.Item label={item.label} key={item.paramName} className={item.className} >
                                                                            <Tooltip
                                                                                trigger={['focus']}
                                                                                title={item.title}
                                                                                placement="topLeft"
                                                                                overlayClassName="numeric-input"
                                                                            >
                                                                                {
                                                                                    getFieldDecorator(item.paramName, {
                                                                                        initialValue: item.initialValue ? item.initialValue : '',
                                                                                        rules: item.rules || null
                                                                                    })(

                                                                                        <TextArea
                                                                                            style={item.style}
                                                                                            placeholder={item.placeholder}
                                                                                            className={item.shuoming}
                                                                                            // onChange={this.onChange}
                                                                                            rows={item.rows}
                                                                                            maxLength={item.num}
                                                                                            disabled={true} id={[item.paramName]}
                                                                                            onChange={this.getChangeValueList.bind(this, item.paramName)} size={config.size} style={item.style}
                                                                                        />

                                                                                    )
                                                                                }
                                                                            </Tooltip>
                                                                        </Form.Item>
                                                                    </Col>
                                                                )
                                                            } else if (item.type === 'delete') {
                                                                return (
                                                                    <Col span={22} key={index} xxl={{ push: 2 }} style={{ textAlign: 'right', height: 20 }} push={2}>
                                                                        {/* <IconFont type="icon-suoding" onClick={this.onDelete.bind(this, item.index)} style={{ fontSize: 16, cursor: 'pointer', width: 20, height: 20, color: 'red' }} />
                                                                        <IconFont type="icon-jiesuo" onClick={this.onHuifu.bind(this, item.index)} style={{ fontSize: 16, cursor: 'pointer', width: 20, height: 20, color: 'green' }} /> */}
                                                                    </Col>
                                                                )
                                                            }

                                                        })


                                                    )
                                                } else if (item.type === 'button') {
                                                    return (
                                                        <Col span={2} key={index} xxl={{ pull: 0 }} style={{ textAlign: 'right', height: 20, width: 2 }} pull={1}>

                                                            {/* <IconFont type="icon-xinzeng" onClick={this.addListfx} style={{ fontSize: 16, cursor: 'pointer', width: 20, height: 20, color: '#16B8BD' }} /> */}
                                                        </Col>
                                                    )
                                                }

                                            })
                                        }

                                    </Row>
                                </Form>
                               
                                {/* 按钮 */}
                                <div className={styles.Bottom_Box}>
                                    <div style={{ color: '#fff', width: 136, height: 32, background: 'rgba(0,171,187,1)', borderRadius: 14, textAlign: 'center', lineHeight: '32px', cursor: 'pointer' }} onClick={this.fanhui}>返回</div>

                                    <div style={{ color: 'red', width: 136, height: 32, background: '#fff', borderRadius: 14, textAlign: 'center', lineHeight: '32px', border: '1px solid #ccc', cursor: 'pointer' }} onClick={this.fanhui}>关闭</div>
                                </div>
                                {/* 子事件区域 */}
                                {

                                    
                                    this.props.eventBasicId && <CheckSubEvent
                                        eventBasicId={this.props.eventBasicId}
                                    />
                                }
                     


                    </div>


                </div>
            </div>
        );


    }
}
export default Form.create()(Check_Wrap);

